Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

ftd.space and ftd.empty rfc #194

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

ftd.space and ftd.empty rfc #194

wants to merge 1 commit into from

Conversation

Arpita-Jaiswal
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Aug 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fastncom ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 3, 2023 0:31am

Comment on lines +14 to +20
The addition of `ftd.space` and `ftd.empty` variables simplifies the process of
adding space character and empty space. By providing these predefined variables
for common formatting needs, makes `ftd` becomes more user-friendly when working
with spacing and empty content.

The `ftd.empty` can be used as default value of string type variable. This
variable can later on append other strings on some events.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should mention how our grammar does not allow people to create space or empty strings.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need motivation for why we need space and empty string. What are the use cases?

Comment on lines +28 to +29
`ftd` will now contains two predefined variables. These will be included in
`default bag` in interpreter.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not mention technical implementation in RFC. Remove the default bag bit.


-- ds.h3: `ftd.empty`

The `ftd.empty` variable is defined to return an empty string.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change line to: The ftd.empty variable contains empty string. Also change the ftd.space. Variables do not return things. Functions return things.

Comment on lines +69 to +79
ftd.space = function(arg) {
let __arg__ = {
a: 0,
...arg
};
if (__arg__.a <= 0) {
return '';
}

return ' '.repeat(__arg__.a);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also tech/implementation detail. RFC should not include implementation details, only end user stuff.

Comment on lines +105 to +106
As of now, there are no unresolved questions or issues related to the proposal
of introducing `ftd.space` and `ftd.empty` variables to the ftd library.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One unresolved question is can we fix our grammar so that this is not needed. This is a limitation of our grammar after all.

@amitu
Copy link
Contributor

amitu commented Aug 4, 2023

@Arpita-Jaiswal I think there is case for ftd.empty: our grammar does not allow any other way to create and empty string and empty string is needed many times (you do not want to show something, ideally that thing should have been optional string, but at least you can try empty string). ftd.space, I do not see any use case for, why would anyone want to insert a single space for any variable? Is it to create padding?

I think we keep the ftd.empty and remove the ftd.space from this RFC and create another RFC for space as that is a different discussion with its own motivation etc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants